package com.easymin.weixin.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 跑腿订单
 *
 * @author Administrator
 */
public class Order implements Serializable {
	private Long id;

	private String orderNo;// 订单号

	private String title;// 任务标题

	@JSONField(format = "yyyy-MM-dd HH:mm")
	private Date deliverTime;// 交付时间

	public List<ErrandOrderTypeOtherServices> getOtherServices() {
		return otherServices;
	}

	public void setOtherServices(
			List<ErrandOrderTypeOtherServices> otherServices) {
		this.otherServices = otherServices;
	}

	public List<ErrandOrderTypeTips> getTipsList() {
		return tipsList;
	}

	public void setTipsList(List<ErrandOrderTypeTips> tipsList) {
		this.tipsList = tipsList;
	}

	public List<ErrandOrderTypeDetailed> getErrandOrderTypeDetaileds() {
		return errandOrderTypeDetaileds;
	}

	public void setErrandOrderTypeDetaileds(
			List<ErrandOrderTypeDetailed> errandOrderTypeDetaileds) {
		this.errandOrderTypeDetaileds = errandOrderTypeDetaileds;
	}

	private String deliverAddress;// 交付地址

	private Double deliverLat;// 交付地址纬度

	private Double deliverLng;// 交付地址经度

	private Long passengerId;// 下单人id

	private String passengerName;// 下单人名字

	private String passengerPhone;// 下单人电话

	private String orderAddress;// 下单地址

	private Double orderLat;// 下单地址纬度

	private Double orderLng;// 下单地址经度

	private Long channelId;// 渠道id

	private String channelName;// 渠道名称

	private Integer status;// 订单状态:0:新单 1:已派单 2:已接单 3:执行中 4:已完成 5:已销单

	private Boolean review;// 是否已经评价

	private Double shouldPay;// 应付

	private Double realPay;// 实收

	private Boolean fixedPrice;// 是否固定订单价格 true:固定价格,false:不固定价格(计价)

	private Long employId;// 接单人id

	private String employName;// 接单人姓名

	private String employPhone;// 接单人电话

	private Long employCompanyId;// 司机所在公司

	private Long companyId;// 分公司id

	private String companyName;// 分公司名称

	private String appkey;// 系统Key

	private Date created;

	private Date updated;

	private Integer version;

	private String content;// 任务内容/备注

	private String cancelCause;// 销单原因

	private List<OrderMemo> memoList;// 订单的所有备注

	private OrderReview orderReview; // 订单评价对象

	private Boolean errandFixPrice; // 是否定价(true:固定价格,false:根据收费标准计算的订单价格)

	private Double distance; // 临时存储订单交付地与司机距离

	private String distanceStr; // 临时存储订单交付地与司机距离(字符串)

	private Date lasturge; // 上次催促时间

	private Date startTime; // 任务开始时间

	private String startPhone; // 任务开始电话

	private String endPhone; // 任务结束电话(交件电话，交付电话)

	private String startAddress; // 开始地址

	private Double startLat; // 开始地址纬度

	private Double startLng; // 开始地址经度

	private String orderType; // 订单类型 other 其它 qusong 取送 daimai 代买 paidui 排队

	private String imgs; // 订单图片路径(多张图片)

	private Double mileage; // 公里 Double

	private Integer travelTime; // 执行时间 Integer (分钟)
	
    private PayTypeDetails prePayTypeDetail; // 预支付方式
    
    private PayTypeDetails payTypeDetails;//后支付方式

	private Double startPrice; // 起步价

	private Double mileagePrice; // 行驶里程费用

	private Double travelTimePrice; // 服务时间费用

	private Long orderTypeId; // 订单类型id

	private String voice;// 语音地址

	private Long couponId;// 优惠券Id

	private Double couponMoney;// 优惠券金额

	private Long areaId; // 收费标准Id

	private boolean treatment;// 是否确认过订单

	private String anonymousNumber;

	private String startDetailed; // 详细起点

	private String endDetailed; // 详细终点

	private String recipients; // 收件人

	private String phone; // 收件人电话

	private String weight; // 重量

	private String matter; // 事项

	private String buyNeeds;// 购买需求

	private Double goodsCash;// 商品金额

	private Double thanksCash;// 感谢费

	private String addServices;// 附加服务

	private String tips;// 热门标签

	private boolean ifPayed;

	private List<ErrandOrderTypeOtherServices> otherServices;// 附加服务

	private List<ErrandOrderTypeTips> tipsList;// 热门标签

	private List<ErrandOrderTypeDetailed> errandOrderTypeDetaileds;// 类型显示字段
	
	

	public boolean isIfPayed() {
		return ifPayed;
	}

	public void setIfPayed(boolean ifPayed) {
		this.ifPayed = ifPayed;
	}

	public String getTips() {
		return tips;
	}

	public void setTips(String tips) {
		this.tips = tips;
	}

	public String getBuyNeeds() {
		return buyNeeds;
	}

	public void setBuyNeeds(String buyNeeds) {
		this.buyNeeds = buyNeeds;
	}

	public Double getGoodsCash() {
		return goodsCash;
	}

	public void setGoodsCash(Double goodsCash) {
		this.goodsCash = goodsCash;
	}

	public Double getThanksCash() {
		return thanksCash;
	}

	public void setThanksCash(Double thanksCash) {
		this.thanksCash = thanksCash;
	}

	public String getAddServices() {
		return addServices;
	}

	public void setAddServices(String addServices) {
		this.addServices = addServices;
	}

	public String getStartDetailed() {
		return startDetailed;
	}

	public void setStartDetailed(String startDetailed) {
		this.startDetailed = startDetailed;
	}

	public String getEndDetailed() {
		return endDetailed;
	}

	public void setEndDetailed(String endDetailed) {
		this.endDetailed = endDetailed;
	}

	public String getRecipients() {
		return recipients;
	}

	public void setRecipients(String recipients) {
		this.recipients = recipients;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getWeight() {
		return weight;
	}

	public void setWeight(String weight) {
		this.weight = weight;
	}

	public String getMatter() {
		return matter;
	}

	public void setMatter(String matter) {
		this.matter = matter;
	}

	public String getAnonymousNumber() {
		return anonymousNumber;
	}

	public void setAnonymousNumber(String anonymousNumber) {
		this.anonymousNumber = anonymousNumber;
	}

	public boolean isTreatment() {
		return treatment;
	}

	public void setTreatment(boolean treatment) {
		this.treatment = treatment;
	}

	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}

	public Long getCouponId() {
		return couponId;
	}

	public void setCouponId(Long couponId) {
		this.couponId = couponId;
	}

	public Double getCouponMoney() {
		return couponMoney;
	}

	public void setCouponMoney(Double couponMoney) {
		this.couponMoney = couponMoney;
	}

	public Long getOrderTypeId() {
		return orderTypeId;
	}

	public void setOrderTypeId(Long orderTypeId) {
		this.orderTypeId = orderTypeId;
	}

	public String getVoice() {
		return voice;
	}

	public void setVoice(String voice) {
		this.voice = voice;
	}

	public Double getMileage() {
		return mileage;
	}

	public void setMileage(Double mileage) {
		this.mileage = mileage;
	}

	public Integer getTravelTime() {
		return travelTime;
	}

	public void setTravelTime(Integer travelTime) {
		this.travelTime = travelTime;
	}

	public Double getStartPrice() {
		return startPrice;
	}

	public void setStartPrice(Double startPrice) {
		this.startPrice = startPrice;
	}

	public Double getMileagePrice() {
		return mileagePrice;
	}

	public void setMileagePrice(Double mileagePrice) {
		this.mileagePrice = mileagePrice;
	}

	public Double getTravelTimePrice() {
		return travelTimePrice;
	}

	public void setTravelTimePrice(Double travelTimePrice) {
		this.travelTimePrice = travelTimePrice;
	}

	public String getEndPhone() {
		return endPhone != null ? endPhone : "";
	}

	public void setEndPhone(String endPhone) {
		this.endPhone = endPhone;
	}

	public String getImgs() {
		return imgs != null ? imgs : "";
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public String getStartPhone() {
		return startPhone != null ? startPhone : "";
	}

	public void setStartPhone(String startPhone) {
		this.startPhone = startPhone;
	}

	public String getStartAddress() {
		return startAddress != null ? startAddress : "";
	}

	public void setStartAddress(String startAddress) {
		this.startAddress = startAddress;
	}

	public Double getStartLat() {
		return startLat != null ? startLat : 0.0;
	}

	public void setStartLat(Double startLat) {
		this.startLat = startLat;
	}

	public Double getStartLng() {
		return startLng != null ? startLng : 0.0;
	}

	public void setStartLng(Double startLng) {
		this.startLng = startLng;
	}

	public String getOrderType() {
		return orderType != null ? orderType : "other";
	}

	public void setOrderType(String orderType) {
		this.orderType = orderType;
	}

	public Date getLasturge() {
		return lasturge;
	}

	public void setLasturge(Date lasturge) {
		this.lasturge = lasturge;
	}

	public String getDistanceStr() {
		return distanceStr;
	}

	public void setDistanceStr(String distanceStr) {
		this.distanceStr = distanceStr;
	}

	public Double getDistance() {
		return distance;
	}

	public void setDistance(Double distance) {
		this.distance = distance;
	}

	public Boolean getErrandFixPrice() {
		return BooleanUtils.toBoolean(errandFixPrice);
	}

	public void setErrandFixPrice(Boolean errandFixPrice) {
		this.errandFixPrice = errandFixPrice;
	}

	public String getPassengerPhone() {
		return passengerPhone != null ? passengerPhone : "";
	}

	public void setPassengerPhone(String passengerPhone) {
		this.passengerPhone = passengerPhone;
	}

	public Boolean getFixedPrice() {
		return fixedPrice;
	}

	public void setFixedPrice(Boolean fixedPrice) {
		this.fixedPrice = fixedPrice;
	}

	public String getEmployPhone() {
		return employPhone != null ? employPhone : "";
	}

	public void setEmployPhone(String employPhone) {
		this.employPhone = employPhone;
	}

	public Long getEmployCompanyId() {
		return employCompanyId;
	}

	public void setEmployCompanyId(Long employCompanyId) {
		this.employCompanyId = employCompanyId;
	}

	public OrderReview getOrderReview() {
		return orderReview;
	}

	public void setOrderReview(OrderReview orderReview) {
		this.orderReview = orderReview;
	}

	public List<OrderMemo> getMemoList() {
		return memoList;
	}

	public void setMemoList(List<OrderMemo> memoList) {
		this.memoList = memoList;
	}

	private static final long serialVersionUID = 1L;

	public String getCancelCause() {
		return cancelCause;
	}

	public void setCancelCause(String cancelCause) {
		this.cancelCause = cancelCause;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		if (StringUtils.isNotBlank(orderNo)) {
			this.orderNo = orderNo.trim();
		} else {
			this.orderNo = null;
		}
	}

	public String getTitle() {
		return title != null ? title : "";
	}

	public void setTitle(String title) {
		this.title = title == null ? "" : title.trim();
	}

	public Date getDeliverTime() {
		return deliverTime;
	}

	public void setDeliverTime(Date deliverTime) {
		this.deliverTime = deliverTime;
	}

	public String getDeliverAddress() {
		return deliverAddress != null ? deliverAddress : "";
	}

	public void setDeliverAddress(String deliverAddress) {
		this.deliverAddress = deliverAddress == null ? "" : deliverAddress
				.trim();
	}

	public Double getDeliverLat() {
		return deliverLat;
	}

	public void setDeliverLat(Double deliverLat) {
		this.deliverLat = deliverLat;
	}

	public Double getDeliverLng() {
		return deliverLng;
	}

	public void setDeliverLng(Double deliverLng) {
		this.deliverLng = deliverLng;
	}

	public Long getPassengerId() {
		return passengerId;
	}

	public void setPassengerId(Long passengerId) {
		this.passengerId = passengerId;
	}

	public String getPassengerName() {
		return passengerName != null ? passengerName : "";
	}

	public void setPassengerName(String passengerName) {
		this.passengerName = passengerName == null ? null : passengerName
				.trim();
	}

	public String getOrderAddress() {
		return orderAddress != null ? orderAddress : "";
	}

	public void setOrderAddress(String orderAddress) {
		this.orderAddress = orderAddress == null ? null : orderAddress.trim();
	}

	public Double getOrderLat() {
		return orderLat;
	}

	public void setOrderLat(Double orderLat) {
		this.orderLat = orderLat;
	}

	public Double getOrderLng() {
		return orderLng;
	}

	public void setOrderLng(Double orderLng) {
		this.orderLng = orderLng;
	}

	public Long getChannelId() {
		return channelId;
	}

	public void setChannelId(Long channelId) {
		this.channelId = channelId;
	}

	public String getChannelName() {
		return channelName != null ? channelName : "";
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName == null ? null : channelName.trim();
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Boolean getReview() {
		return review;
	}

	public void setReview(Boolean review) {
		this.review = review;
	}

	public Double getShouldPay() {
		return shouldPay != null ? shouldPay : 0;
	}

	public void setShouldPay(Double shouldPay) {
		this.shouldPay = shouldPay;
	}

	public Double getRealPay() {
		return realPay;
	}

	public void setRealPay(Double realPay) {
		this.realPay = realPay;
	}

	public Long getEmployId() {
		return employId;
	}

	public void setEmployId(Long employId) {
		this.employId = employId;
	}

	public String getEmployName() {
		return employName != null ? employName : "";
	}

	public void setEmployName(String employName) {
		this.employName = employName;
	}

	public Long getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Long companyId) {
		this.companyId = companyId;
	}

	public String getCompanyName() {
		return companyName != null ? companyName : "";
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName == null ? null : companyName.trim();
	}

	public String getAppkey() {
		return appkey;
	}

	public void setAppkey(String appkey) {
		this.appkey = appkey == null ? null : appkey.trim();
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getContent() {
		return content != null ? content : "";
	}

	public void setContent(String content) {
		this.content = content == null ? null : content.trim();
	}
	
	public PayTypeDetails getPrePayTypeDetail() {
      return prePayTypeDetail;
    }
  
    public void setPrePayTypeDetail(PayTypeDetails prePayTypeDetail) {
      this.prePayTypeDetail = prePayTypeDetail;
    }
  
    public PayTypeDetails getPayTypeDetails() {
      return payTypeDetails;
    }
  
    public void setPayTypeDetails(PayTypeDetails payTypeDetails) {
      this.payTypeDetails = payTypeDetails;
    }



    public enum PayTypeDetails {
      /**
       * 代付
       */
      helppay,
      /**
       * 签单
       */
      sign,
      /**
       * 余额
       */
      balance,
      /**
       * 支付宝
       */
      alipay,
      /**
       * 微信
       */
      weixin,
      /**
       * 银联支付
       */
      unionpay,
      /**
       * 优惠劵
       */
      coupon,
      
      /**
       * 优惠劵+签单
       */
      coupon_sign,
      /**
       * 优惠劵+余额
       */
      coupon_balance,
      /**
       * 优惠劵+支付宝
       */
      coupon_alipay,
      /**
       * 优惠劵+微信
       */
      coupon_weixin,
      /**
       * 优惠劵+银联
       */
      coupon_unionpay,
      /**
       * 现金
       */
      cash, 
      /**
       * 余额+现金
       */
      balance_cash
      
    }

	@Override
	public String toString() {
		return "Order [id=" + id + ", orderNo=" + orderNo + ", title=" + title
				+ ", deliverTime=" + deliverTime + ", deliverAddress="
				+ deliverAddress + ", deliverLat=" + deliverLat
				+ ", deliverLng=" + deliverLng + ", passengerId=" + passengerId
				+ ", passengerName=" + passengerName + ", passengerPhone="
				+ passengerPhone + ", orderAddress=" + orderAddress
				+ ", orderLat=" + orderLat + ", orderLng=" + orderLng
				+ ", channelId=" + channelId + ", channelName=" + channelName
				+ ", status=" + status + ", review=" + review + ", shouldPay="
				+ shouldPay + ", realPay=" + realPay + ", fixedPrice="
				+ fixedPrice + ", employId=" + employId + ", employName="
				+ employName + ", employPhone=" + employPhone + ", companyId="
				+ companyId + ", companyName=" + companyName + ", appkey="
				+ appkey + ", created=" + created + ", updated=" + updated
				+ ", version=" + version + ", content=" + content
				+ ", cancelCause=" + cancelCause + ", memoList=" + memoList
				+ ", orderReview=" + orderReview + ", errandFixPrice="
				+ errandFixPrice + ", distance=" + distance + ", distanceStr="
				+ distanceStr + ", lasturge=" + lasturge + ", startTime="
				+ startTime + ", startPhone=" + startPhone + ", endPhone="
				+ endPhone + ", startAddress=" + startAddress + ", startLat="
				+ startLat + ", startLng=" + startLng + ", orderType="
				+ orderType + ", imgs=" + imgs + ", mileage=" + mileage
				+ ", travelTime=" + travelTime + ", startPrice=" + startPrice
				+ ", mileagePrice=" + mileagePrice + ", travelTimePrice="
				+ travelTimePrice + ", orderTypeId=" + orderTypeId + ", voice="
				+ voice + "]";
	}

}
